<template>
	<view class="shop_dea1" v-if="info">

		 <rich-text :nodes="info.content"></rich-text>
	
		 <view style="width: 100%;height: 120rpx;">
			 
		 </view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
				info: [],
				 imgList: [
					// {url:'../../static/grid/banner1.png'},
					// {url:'../../static/grid/banner2.png'},
					// {url:'../../static/grid/banner3.png'},
					// {url:'../../static/grid/banner4.png'},
				],
			};
		},
		onLoad(ops) {
			this.id = ops.id;
		},
		onShow(){
		
			this.get_info();
		},
	
		methods: {
			
			chushou(){
				uni.showToast({
					title: "该商品暂未开放出售",
					icon: 'none'
				})
			},
			goumai(){
				uni.showToast({
					title: "金币不足",
					icon: 'none'
				})
			},
			get_info(){
				
				uni.showLoading({ title: '正在加载', mask: true });
				var _this = this;
				_this.$api.request('/api/user/getNoticeDeaXieyi', {id:_this.id}, uni.getStorageSync('token'), function(res) {
					uni.hideLoading();
					if (res.code == 1) {
					
						let richtext =  res.data.content;
						const regex = new RegExp('<img', 'gi');
						richtext = richtext.replace(regex,'<img style="width: 100%;"');
						//再不济，加上这个
						const regex1 = new RegExp('data-fail="0" style="', 'gi');
						richtext = richtext.replace(regex1,'data-fail="0" style="width: 100%;');
						 res.data.content = richtext
					
						_this.info = res.data;
				
						
						
					}
					uni.hideLoading();
				});
			},
			
		}
	};
</script>

<style lang="scss">
	page{
		background:#fff
	}
	
</style>
